public class demo3 {
    public String modifyString(String s) {
        int n=s.length();
        char[]arr=s.toCharArray();
        for(int i=0;i<n;i++){
            if(arr[i]=='?'){
                for(int x=0;x<26;x++){
                    if(i==0||arr[i]!=arr[i-1]&&(i==n-1||arr[i]!=arr[i+1]))break;
                    arr[i]= (char) (arr[i]+'x');
                }
            }
        }
        return String.valueOf(arr);
    }
}
